package com.nf.recruitment.controller;

import com.nf.recruitment.dto.PostInfoDTO;
import com.nf.recruitment.dto.PostInfoPageDTO;
import com.nf.recruitment.entity.Degree;
import com.nf.recruitment.entity.PostInfo;
import com.nf.recruitment.service.DegreeService;
import com.nf.recruitment.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/degree")
public class DegreeController extends BaseController{
    @Autowired
    private DegreeService service;

    @GetMapping("/list")
    public ResultVO<List<Degree>> listDegree() {
        List<Degree> degrees = service.listDegree();

        return new ResultVO<>(200, "", degrees);
    }

    @PostMapping("/save")
    public ResultVO saveDegree(@RequestBody Degree dto) {
        service.saveDegree(dto);
        return success();
    }
}
